//    Copyright (C) Kherty.  All rights reserved.
using System.Windows.Media.Media3D;

namespace OpenLS.Chart.UI
{
    abstract class MeshGeometryFactory
    {
        protected MeshGeometryFactory(BarDirection direction)
        {
            Direction = direction;
        }

        protected BarDirection Direction { get; set; }
        public abstract MeshGeometry3D CreateGeometry(Bounds3D bounds, Bounds totalValueBounds2, double floor);
        internal Bounds GetValueBounds(Bounds3D bounds3D)
        {
            switch (Direction)
            {
                case BarDirection.Column:
                    return bounds3D.Y;
                default:
                    return bounds3D.X;
            }
        }
        internal double GetValue (Point3D point)
        {
            switch (Direction)
            {
                    case BarDirection.Column:
                    return point.Y;
                    default:
                    return point.X;
            }
        }
        internal double GetCategory(Point3D point)
        {
            switch (Direction)
            {
                case BarDirection.Column:
                    return point.X;
                default:
                    return point.Y;
            }
        }
        internal Bounds GetCategoryBounds(Bounds3D bounds3D)
        {
            switch (Direction)
            {
                case BarDirection.Column:
                    return bounds3D.X;
                default:
                    return bounds3D.Y;
            }
        }
        internal Point3D CreatePoint(double value, double category, double z)
        {
            switch (Direction)
            {
                case BarDirection.Column:
                    return new Point3D(category, value, z);
                default:
                    return new Point3D(value, category, z);
            }
        }
        internal Vector3D CreateVector(double value, double category, double z)
        {
            switch (Direction)
            {
                case BarDirection.Column:
                    return new Vector3D(category, value, z);
                default:
                    return new Vector3D(value, category, z);
            }
        }


    }
}
